VRMLEyes demonstration version will load the VRML files supplied with the program, other VRML files will not be recognised.
However, the demo version will allow users to create their own shapes in the form of
simple textfiles. The program will respond to commands for the following basic shapes:
Sphere / Cube / Cone / Cylinder
These shapes are just a taster of VRML, and tiny part of what VRML has to offer. VRML is designed to
create entire 3D immersive and interactive worlds. As VRMLEyes develops it will support the richer behaviours of VRML 2 which include animation, Java scripting, 3D sound, collisions and more.
A SIMPLE VRML FILE
~~~~~~~~~~~~~~~~~~
All VRML files consist of a header followed by some information about the model, a Sphere for
example is represented by the follwing text:
NOTE: VRMLEyes is case sensitive.
EXAMPLE 1. Sphere
~~~~~~~~~~~~~~~~~~~~
#VRML V1.0 ascii # this is the header, it says
# to VRMLEyes; " get your pen out
# and get ready to start drawing"
Sphere {
radius 2.0
} # this is the first complete instruction
# it is telling VRML to draw a Sphere
# with a radius of 2 units
EXAMPLE 2. Shading a shape using 'Materials' (add a bit of colour!).
You can colour your shape how you like by including values (between 0 and 1) for each of the
colours Red, Green and Blue.
There are several nodes (commands) used to colour an object diffuse, emmisive, specular, shininess, ambient and transparency. VRMLEyes recognises these nodes.
diffuseColor simply 'colours' the shape.
A red Sphere
~~~~~~~~~~~~
#VRML V1.0 ascii # header
Material { # get ready to do something like colour the object)
diffuseColor 1.0 0.0 0.0
} # get ready with max red, no green and no blue
# watch out for spelling and case!
Sphere {
radius 2.0
} # now draw the sphere, all in red
Experiment with different colours:
Red Green Blue
1.0 0.0 0.0 (Pure red)
0.5 0.0 0.0 (dark red)
1.0 1.0 0.0 (Yellow)
1.0 0.0 1.0 (Magenta)
etc.
The demo version also supports 'shininess'
Try amending the above example:
#VRML V1.0 ascii
Material {
diffuseColor 1.0 0.0 0.0
shininess 0.1 # make the object shiny, value between 0 and 0.5
}
Sphere {
radius 2.0
} # now draw the sphere, in shiny red
Cube, Cylinder and Cone?
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Try writing new VRML textfiles to draw these other shapes on the screen.
VRMLEyes demo version regognises the following style of commands:
Don't forget the headers etc.
To make a cube
~~~~~~~~~~~~~~
Cube {
height 2.0
width 4.0
depth 6.0
} (make a cuboid 2x4x6 units)
To make a Cylinder
~~~~~~~~~~~~~~~~~~
Cylinder {
height 4.0
radius 2.0
} (make a cylinder 4 units high and 4 wide)
To make a Cone
~~~~~~~~~~~~~~
Cone {
height 6.0
bottomRadius 2.0
} (make a cone which is 6 units high with a base 4 units wide)
NB. The units can be of any desired measurement. If you chose centimeters as your base then all other measurements in the complete model should be centimeters as well. VRMLEyes can place your
object accurately wherever desired.
PLACING A SHAPE
~~~~~~~~~~~~~~~
VRMLEyes can be told to move a shape using the 'Translation' node.
The Translation node can be used to place an object accurately anywhere in 3D space relative
to the previous origin. This is achieved by defining a new position in the X, Y and Z planes.
First choose a scale, centimeters for example.
The following example draws one cube in the centre of the screen then draws as second cube to sit on top of it.
#VRML V1.0 ascii # header
Cube {
height 2.0 # draw a cube 2x2x2 metres
width 2.0
depth 2.0
}
Translation {
translation 0.0 2.0 0.0 # translate, or move, the point of origin 2 in the Y plane.
# if the number was -2 then the origin would be moved downward
}
Cube {
height 2.0 # Draw a second cube at the new origin
width 2.0
depth 2.0
}
ROTATING A SHAPE
~~~~~~~~~~~~~~~~
Each shape can be rotated in any direction by a specific amount in any direction. This function
is controlled by the Rotation Node. Its OK to think in degrees but you will need to convert all
your angles to radians before using them with VRML.
The following example describes a 'Cross' shape made from two cylinders. see example file 3.
rotation 0.0 0.0 1.0 1.0472 # rotate the cylinder in the Z axis by 1.0472
# radians (60 degrees). The figure 0.0 0.0 1.0
# represent the X, Y and Z axix. The Z axis is
# set with a '1' followed by the angle in radians.
# 0.0 1.0 0.0 1.0472 would rotate the cylinder
# in the Y axis
}
Cylinder {
height 30.0
radius 2.0
}
***This example produces intersecting shapes, so the Z Buffer will need to be used.
RADIANS
~~~~~~~
for those who can't remember school:
rad = (deg / 180) x 3.142
Common angles:
Degrees Radians
30 deg 0.524 rad
60 deg 1.0472
90 deg 1.571
180 deg 3.142
270 deg 4.172
The products VRMLEyes an DaVinci90 will render raw VRML files as data or text files, which how they normally arrive. If the filetype is set to VRML then a VRML model can be loaded by double-clicking.
With VRMLEyes demonstration one can can create quite complex shapes, colour them, move
and rotate them. Why not buy the complete version and join in at the start of the rapidly
growing world of 3D.
VRMLEyes will also load and render any DaVinci90 3D model. DaVinci is a 3D modeller which could be refarded as a VRML editor.